<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Controller_Events extends Controller_Template {
	public function actionIndex() {
		$this->addStyle('/styles/jquerytools/overlay.css');
		$this->addStyle('/styles/jquerytools/gallery.css');
		$this->addScript('/scripts/jquerytools/jquery.tools.min.js');
		$this->addScript('/scripts/plugin/gallery.js');

		$this->template->title = "SPECIAL EVENTS & STREET FESTIVALS -".$this->settings['title'];
		$this->template->content = new View('events/index');
		$text = Model::factory('directory')->getItemByToken('qqj', 'text');
		$this->template->content->text = $text;
		$events = Model::factory('directory')->getItems('events', 'position', 'ASC');
		if (!$events) {
			$this->template->content->error = "Events not found";
		}
		$this->template->content->events = $events;
		$this->template->content->attachmentPath = "/content/directory/attachments/";
		$attachments = Model::factory('directory')->getAttachmentsByItem('events');
		$this->template->content->attachments = $attachments;
		$images = Model::factory('directory')->getImagesByItem('events');
		$this->template->content->images = $images;
	}
}
?>
